I am currently working on an ado-file. After running the ado, the weight is returned in the local `weight'. This works fine.
However, I also need to extract the variable name.
So far, I use this syntax, to create a second local (weight2):
However, using "-5" to extract the last characters night lead to problems. Maybe there is another way? Could I use "ustrregexs" to extract the letter "V" and the 3 numbers instead? How?
Thanks, Simon
However, I also need to extract the variable name.
Code:
local weight = "[iweight= V016]"
Code:
local weight2 = substr("`weight'", -5, .) local weight2: subinstr local weight2 "]" "", all di "`weight2'"
Thanks, Simon
Comment